﻿
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using Digitalmes.Model.ProcessManagement;
using Digitalmes.Model;

namespace Digitalmes.ViewModel.ProcessManagement.ProcessRouteItemVMs
{
    public partial class ProcessRouteItemTemplateVM : BaseTemplateVM
    {
        
        [Display(Name = "_Model._ProcessRouteItem._Routie")]
        public ExcelPropety Routie_Excel = ExcelPropety.CreateProperty<ProcessRouteItem>(x => x.RoutieId);
        [Display(Name = "_Model._ProcessRouteItem._OpCode")]
        public ExcelPropety OpCode_Excel = ExcelPropety.CreateProperty<ProcessRouteItem>(x => x.OpCode);
        [Display(Name = "_Model._ProcessRouteItem._StdOpDuration")]
        public ExcelPropety StdOpDuration_Excel = ExcelPropety.CreateProperty<ProcessRouteItem>(x => x.StdOpDuration);
        [Display(Name = "_Model._ProcessRouteItem._StdPrepDuration")]
        public ExcelPropety StdPrepDuration_Excel = ExcelPropety.CreateProperty<ProcessRouteItem>(x => x.StdPrepDuration);
        [Display(Name = "_Model._ProcessRouteItem._Pos")]
        public ExcelPropety Pos_Excel = ExcelPropety.CreateProperty<ProcessRouteItem>(x => x.Pos);
        [Display(Name = "_Model._ProcessRouteItem._PolicyCheckPrevProc")]
        public ExcelPropety PolicyCheckPrevProc_Excel = ExcelPropety.CreateProperty<ProcessRouteItem>(x => x.PolicyCheckPrevProc);
        [Display(Name = "_Model._ProcessRouteItem._PolicyCheckProcBom")]
        public ExcelPropety PolicyCheckProcBom_Excel = ExcelPropety.CreateProperty<ProcessRouteItem>(x => x.PolicyCheckProcBom);
        [Display(Name = "_Model._ProcessRouteItem._PolicyCheckProcess")]
        public ExcelPropety PolicyCheckProcess_Excel = ExcelPropety.CreateProperty<ProcessRouteItem>(x => x.PolicyCheckProcess);
        [Display(Name = "_Model._ProcessRouteItem._CtlAttr")]
        public ExcelPropety CtlAttr_Excel = ExcelPropety.CreateProperty<ProcessRouteItem>(x => x.CtlAttr);
        [Display(Name = "_Model._ProcessRouteItem._ErpOpCode")]
        public ExcelPropety ErpOpCode_Excel = ExcelPropety.CreateProperty<ProcessRouteItem>(x => x.ErpOpCode);
        [Display(Name = "_Model._ProcessRouteItem._Etag")]
        public ExcelPropety Etag_Excel = ExcelPropety.CreateProperty<ProcessRouteItem>(x => x.Etag);
        [Display(Name = "_Model._ProcessRouteItem._Active")]
        public ExcelPropety Active_Excel = ExcelPropety.CreateProperty<ProcessRouteItem>(x => x.Active);
        [Display(Name = "_Model._ProcessRouteItem._Aux_1")]
        public ExcelPropety Aux_1_Excel = ExcelPropety.CreateProperty<ProcessRouteItem>(x => x.Aux_1);
        [Display(Name = "_Model._ProcessRouteItem._Aux_2")]
        public ExcelPropety Aux_2_Excel = ExcelPropety.CreateProperty<ProcessRouteItem>(x => x.Aux_2);
        [Display(Name = "_Model._ProcessRouteItem._OpName")]
        public ExcelPropety OpName_Excel = ExcelPropety.CreateProperty<ProcessRouteItem>(x => x.OpName);
        [Display(Name = "_Model._ProcessRouteItem._GroupCode")]
        public ExcelPropety GroupCode_Excel = ExcelPropety.CreateProperty<ProcessRouteItem>(x => x.GroupCode);
        [Display(Name = "_Model._ProcessRouteItem._EquipmentId")]
        public ExcelPropety EquipmentId_Excel = ExcelPropety.CreateProperty<ProcessRouteItem>(x => x.EquipmentId);
        [Display(Name = "_Model._ProcessRouteItem._EquipmentCode")]
        public ExcelPropety EquipmentCode_Excel = ExcelPropety.CreateProperty<ProcessRouteItem>(x => x.EquipmentCode);
        [Display(Name = "_Model._ProcessRouteItem._OpType")]
        public ExcelPropety OpType_Excel = ExcelPropety.CreateProperty<ProcessRouteItem>(x => x.OpType);
        [Display(Name = "_Model._ProcessRouteItem._CreateTime")]
        public ExcelPropety CreateTime_Excel = ExcelPropety.CreateProperty<ProcessRouteItem>(x => x.CreateTime, true);
        [Display(Name = "_Model._ProcessRouteItem._UpdateTime")]
        public ExcelPropety UpdateTime_Excel = ExcelPropety.CreateProperty<ProcessRouteItem>(x => x.UpdateTime, true);
        [Display(Name = "_Model._ProcessRouteItem._CreateBy")]
        public ExcelPropety CreateBy_Excel = ExcelPropety.CreateProperty<ProcessRouteItem>(x => x.CreateBy);
        [Display(Name = "_Model._ProcessRouteItem._UpdateBy")]
        public ExcelPropety UpdateBy_Excel = ExcelPropety.CreateProperty<ProcessRouteItem>(x => x.UpdateBy);
        [Display(Name = "_Model._ProcessRouteItem._IsValid")]
        public ExcelPropety IsValid_Excel = ExcelPropety.CreateProperty<ProcessRouteItem>(x => x.IsValid);
        [Display(Name = "_Model._ProcessRouteItem._TenantCode")]
        public ExcelPropety TenantCode_Excel = ExcelPropety.CreateProperty<ProcessRouteItem>(x => x.TenantCode);

	    protected override void InitVM()
        {
            
            Routie_Excel.DataType = ColumnDataType.ComboBox;
            Routie_Excel.ListItems = DC.Set<ProcessRoute>().GetSelectListItems(Wtm, y => y.TenantCode.ToString());

        }

    }

    public class ProcessRouteItemImportVM : BaseImportVM<ProcessRouteItemTemplateVM, ProcessRouteItem>
    {
            //import

    }

}